<template>
	<view>
		<web-view src="https://damadaojia.com/api.html"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		onLoad: function(e) {
			let _this = this;
			
			
			
			if (e.id && e.FullName) {
				console.log(e);

				_this._post_form('user/googlelogin', {
					googleid: e.id,
					nickName: e.FullName,
					avatarUrl: e.ImageURL,
					wxapp_id: _this.siteInfo.wxapp_id,
				}, function(result) {
					// console.log(result);return false;
					console.log(result.data.token);
					uni.setStorageSync('token', result.data.token);
					uni.setStorageSync('user_id', result.data.user_id);
					console.log('登陆成功');
					// 跳转回原页面/
					_this.navigateBack();
				}, false, function() {
					uni.hideLoading();
				});

			}

		},
		methods: {
			/**
			 * 授权成功 跳转回原页面
			 */
			navigateBack: function() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			},
		}
	}
</script>

<style>

</style>
